Recently, multi-core processors are used widely for High Performance Computing in embedded systems such as mobile phone and tablet PC. The multi-core system is used for handling higher performance embedded applications. The multi-core system has to process various interrupt requests generated between peripheral devices and cores. In order to enhance the performance of the multi-core system, it is one of the significant issues to distribute the loads fairly among the cores.
However, the interrupt is not controlled by the scheduling of the normal Operating System. Accordingly, the load imbalance among the cores may cause bottleneck effect to the system. In order to improve the processing performance of the multi-core system, there is a need of a method of processing interrupts efficiently.
Many researches have been conducted on the method of allocating interrupts to the cores in the multicore system. A few conventional technologies of handling interrupts are described hereinbelow.
The first distribution method is to distribute the interrupts based on the number of interrupts processed by the core. The interrupt allocation device calculates interrupt load index based on the number of interrupts processed by one core during a predetermined time period. The interrupt allocation device allocates the interrupt occurring at the highest frequency to the core processed the least number of interrupts. The interrupt allocation device adjusts the number of interrupts to be handled by each core in this way.
According to the first distribution method, the interrupts are distributed based on the number of processed interrupts, thereby causing the following problem. The interrupt handling time varies depending on the interrupt service routine. Accordingly, although the numbers of interrupt processing times of the respective cores are maintained equally, the load may not be distributed evenly.
The second distribution method is to allocate the interrupts occurring during a predetermined time period to one core. For example, the interrupt allocation device allocates all of the interrupts occurring during the time period t0 to the core 0 and all of the interrupts occurring during the time period t1 to the core 1. The interrupt allocation device changes the core to be allocated interrupts at a predetermined interval. The interrupt allocation device allocates the interrupts occurring during a predetermined time period to the corresponding core so as to adjust the number of interrupts allocated to each core.
According to the second distribution method, if several interrupts occur simultaneously, the interrupts may be concentrated to a specific core. In this case, the Interrupt Response Time increases so as to cause a problem of degrading the system performance.
The third distribution method is for a device driver to determine the core to process the interrupt. The device driver monitors the usage of the core periodically. If the difference between the usage of the core allocated a specific interrupt previously and the usage of the core having the least usage is greater than a predetermined margin, the device driver allocates the corresponding interrupt to the core having the least usage.
According to the third distribution method, the device driver monitors the usage of each core and allocates the interrupt to the core having the lease usage. In this case, several interrupts are concentrated to the core having the least usage so as to cause the problem of increasing the Interrupt Response Time. Also, the scheduler of the normal operating system performs load balancing in a way of balancing the usages of the cores. At this time, the interrupt allocation process of the device driver and the load balancing process of the schedule may collide and thus degrade the system performance.
The fourth distribution method is to distribute interrupts based on token. If an interrupt occurs outside, the interrupt allocation device generates a token. Afterward, the interrupt allocation device transfers the corresponding interrupt to a Hot Group assigned with priority. In the case that the first core of the hot group is capable of processing the corresponding interrupt, it processes the interrupt. In the case that the first core of the hot group is incapable of processing the corresponding interrupt, the corresponding core transfer the corresponding interrupt to another core and, at this time, the number of tokens decrement by 1. The interrupt processing device performs of finding the core capable of processing the interrupt until the number of token becomes 0. If the number of tokens becomes 0, the core which has received the corresponding interrupt at the time when the number of tokens becomes 0 processes the corresponding interrupt.
According to the fourth distribution method, the time taken to allocate the interrupt and complete processing it is likely to be elongated. If the number of tokens is set to a small value in order to avoid the above problem, the first core of the hot group processes the interrupts mostly. As a result, interrupt processing is concentrated to a specific core.